var slider = {
        is_ie: navigator.userAgent.indexOf('MSIE') > 0,
        attr: {
            onClick: navigator.userAgent.indexOf('MSIE') >0 ? 'onclick' : 'onClick'
        },
        home: {
                header: {}
        }
}

slider.home.header = {
    openedItem: 1,
    maxNum: 4,
    mouse_over: 0,
    items: [],
    
    expand: function( itemNum, from_timer ) {
        var obj = slider.home.header;
        
        if( from_timer && obj.mouse_over==1 ) return;
            
        var number         = this.items[ itemNum ][0];

                
        if( number == (this.openedItem-1) && !from_timer ) return;
            slider.home.header.openedItem = number+1;
        
        $('#sizzles img').fadeOut();
        
        $('#sizzleImg0').stop();
        $('#sizzleImg'+number).fadeIn();
        
        $('.sizzle_title').animate({marginTop:'300px',queue:true});
        
        
        $('#sizzle_items a').css('color', '#fff');
        $('#sizzle_item_'+number).css('color', '#fff');    
        $('#sizzle_items a').removeClass('showpagePoint').addClass('showpageNum');        
        $('#sizzle_item_'+number).removeClass('showpageNum').addClass('showpagePoint');
        $('#sizzle_title'+number).animate({marginTop:'165px',queue:true});
    
        if( number >= slider.home.header.maxNum )
            this.openedItem = 0;            
    },
    
    set_timer:function(){
        this.timer();
        $('#subHeader').hover(
          function () {
                  slider.home.header.mouse_over = 1;
                $('#learnMoreContainer .inner').show().animate({marginTop:'0px',queue:false,opacity:1},250);
          }, 
          function () {
                slider.home.header.mouse_over = 0;
                $('#learnMoreContainer .inner').animate({marginTop:'20px',queue:false,opacity:0},500);
          }
        );

    },
    
    timer: function(){
        var bs = slider.home.header;
        if( !this.interval )
            this.interval = setInterval(function(){ 
                    var item = bs.items[bs.openedItem];
                    bs.expand(item[0], 1); 
                },7000);
    },
    
    kill_timer: function(){
        clearInterval(slider.home.header.interval);
        slider.home.header.interval = null;    
    }
}
